//
//  UITextField+XHLKit.m
//  XHLKit
//
//  Created by qinyulun on 16/6/18.
//  Copyright © 2016年 leTian. All rights reserved.
//

#import "UITextField+XHLKit.h"

@implementation UITextField (XHLKit)

+ (UITextField *)textFieldWithRect:(CGRect)rect
                              text:(NSString *)text
                       placeholder:(NSString *)placeholder
                         textColor:(UIColor *)textColor
                          fontSize:(CGFloat)fontSize
                     textAlignment:(NSTextAlignment)textAlignment {
    __autoreleasing UITextField *textField = [[UITextField alloc] init];
    textField.frame = rect;
    textField.text = text;
    textField.textColor = textColor;
    textField.placeholder = placeholder;
    textField.font = [UIFont systemFontOfSize:fontSize];
    textField.textAlignment = textAlignment;
    textField.clearButtonMode=UITextFieldViewModeWhileEditing;
    return textField;
}

@end
